﻿//----------------------------------------------------------------
// Copyright (c) 2011-2013 
// All rights reserved.
// Author: Ben DaoWei 
// Contact: bendaowei@gmail.com
// Web Link: http://xnaeditor.codeplex.com
// ----------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace UnityEngine.Graphics
{
    public enum ERenderState : uint
    {
        // Render state mode
        Opaque = 0,
        Translucent = 1,
        Transparent = 2,
        Additive = 3,
        AdditiveAlpha = 4,
        ParticleAccumulationBuffer = 5,
        ShadowDarkening = 6,
        ThatCrazyBlendModeWeUsedForTheReflections = 7,
        BlendModeMask = 7,

        // Depth buffer states.
        DisableDepth = 8 * 0,
        EnableDepth = 8 * 1,
        DepthTestButNoWrites = 8 * 2,
        StencilShadowMode = 8 * 3,
        DepthBufferMask = 8 * 3,

        // CullMode
        NoCull = 32 * 0,
        CullClockWise = 32 * 1,
        CullCounterClockWise = 32 * 2,
        CullModeMask = 32 * 3,

        // FillMode
        Solid = 0,
        WireFrame = 128 * 1,
        Point = 128 * 2,
        FillModeMask = 128 * 3,

        Initialize = 7 | (8 * 3) | (32 * 3) | 128 * 3,
        None = 0,
    }

    class RenderStateManager
    {
        private ERenderState _PreviousState;

        private GraphicsDevice _GraphicsDevice;

        public void Initialize(GraphicsDevice GraphicsDevice)
        {
            _GraphicsDevice = GraphicsDevice;
            _PreviousState = ERenderState.Initialize;
            SetRenderStates(ERenderState.None);
        }

        private static RenderStateManager _Instance = null;
        public static RenderStateManager Instance
        {
            get
            {
                if (_Instance == null)
                    _Instance = new RenderStateManager();
                return _Instance;
            }
        }

        public void SetRenderStates(ERenderState state)
        {
        }
    }
}